home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: yang@math.umass.edu (Huayong Yang)
- Newsgroups: comp.lang.c,comp.lang.c.moderated
- Subject: Re: Leading and Trailing Blanks
- Date: 5 Jan 1996 09:53:40 -0600
- Organization: UMass/Amherst Dept Math & Stats
- Sender: clc@solutions.solon.com
- Approved: clc@solutions.solon.com
- Message-ID: <4cjhi4$fa2@solutions.solon.com>
- References: <4chh1b$685@solutions.solon.com>
- NNTP-Posting-Host: solutions.solon.com
- X-Newsreader: Tin 1.1 PL362948
-
-
- mskc@io.com (Casey Claiborne) writes:
- : I am wondering if anyone out there has a program (or knows of one)
- : that allows one to strip leading and trailing blanks from a string.
- : ex:
- :
- : char test[20];
- : strcpy(test," TESTING ");
- : printf("%s", test);
-
- How about this:
-
- char test[20], temp[20];
- strcpy(test," TESTING ");
- sscanf(test, "%s", temp);
- printf("%s", temp);
-
- --
- Huayong
-
- WWW home pages: Email:
- http://www.math.umass.edu/~yang yang@math.umass.edu
-